<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>水平垂直居中</title>
  <style>
    #container{
      width: 100%;
      height: 500px;
      border: 2px solid #e4393c;
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    #container .child{
      width: 100px;
      height: 100px;
      background-color: chartreuse;
    }
    /* #container .child{
      position: absolute;
      top:50%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
    } */
    /* #container .child{
      position: absolute;
      top:50%;
      left: 50%;
      margin-top: -50px;
      margin-left: -50px;
    } */
    #box{
      width: 100%;
    }
    .iframe-1{
      width: 1500px;
      height: 300px;
    }
    .iframe-2{
      width: 600px;
      height: 400px;
    }
  </style>
</head>
<body>
  <div id="app">
    <div id="container" onclick="alert('are you ready ?')">
      <div class="child"></div>
    </div>
    <template id="fooo">
      <p>i'm is template tipd</p>
    </template>
    <div id="box">
      <!-- <iframe class="iframe-1" src="http://jd.com" frameborder="0"></iframe> -->
      <iframe class="iframe-2" src="http://127.0.0.1/:9527//#/login" frameborder="0"></iframe>
    </div>

  </div>
  <script>
    var child1= document.getElementsByClassName('child')[0]
    child1.addEventListener('contextmenu',(e)=>{
      e.preventDefault()
      console.log('0000000-------------000000000000')
    })
  </script>
</body>
</html>